#ifndef __SOCKET_CLIENT_H__
#define __SOCKET_CLIENT_H__

#include "SocketBase.h"
#include "Opcodes.h"
typedef char WorldPacket;

#define ThreadLocker		std::lock_guard<std::mutex>
class SocketClient : public SocketBase
{
public:
	SocketClient(void);
	~SocketClient(void);
	bool connectServer(const char* serverIP, unsigned short port);
	void sendMessage(const char* data, int count = 0);
	std::function<void(const char* data, int count)> onRecv;
	std::function<void()> onDisconnect;
	static SocketClient* GetInstance();
private:
	bool initClient();
	void recvMessage();
	void MessageComming(std::string args);
private:

	HSocket _socketServer;
	HSocket _socektClient;

};



#endif